Skip to content

feat: integrate LatentMesh advisory communications - #5

Merged
ruvnet merged 2 commits into
mainfrom
feat/latentmesh-comms-orchestration
Sep 1, 2026
Merged

ruvnet merged 2 commits into
mainfrom
feat/latentmesh-comms-orchestration

Conversation

@ruvnet

@ruvnet ruvnet commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Closes #4

Outcome

Integrates LatentMesh as an optional authenticated communications and advisory orchestration plane. The implementation is intentionally outside every flight-control and onboard safety authority path.

Architecture

  1. Exact upstream pin: ruvnet/LatentMesh@1ff7332c17798eec3b42da5c6f1c271f355fa806
  2. Canonical Q16.16 peer state and stable schema identifiers
  3. Ed25519 signed semantic envelopes with software-key and HSM or keystore signer seam
  4. Per-source bounded reassembly, hard deadlines, pre-authentication rate limits, replay windows, 64-bit logical sequence, epoch rotation, and serializable checkpoints
  5. Periodic signed keyframes every 16 messages for datagram loss recovery
  6. WiFi, BLE, and Meshtastic Air profiles
  7. Bounded Tokio channel and connected UDP datagram transports
  8. Adaptive utility-per-byte scheduling with deadline, link loss, acknowledgement, redundancy, and energy controls
  9. Private trust metadata and a separate TTL advisory store
  10. Locally approved opaque mission manifests for nonbinding task proposals

Non-negotiable authority boundary

LatentMesh cannot arm, disarm, actuate, select a flight mode, publish attitude, rate, velocity, or position setpoints, override geofences or failsafes, release payloads, enter authoritative peer_states, or drive collision avoidance.

Authenticated peer facts can only reduce that peer's eligibility for new cooperative work. Learned residuals in received state envelopes reject the whole envelope without snapshot or replay change.

The review also found and fixed an existing fail-open NaN path in nearest-peer distance calculation. Nonfinite peer geometry now drives the existing emergency-diverge failsafe.

Security and availability controls

  1. Strict source-to-key and transport-to-expected-source binding
  2. Complete signed outer/body metadata binding
  3. Replay commit only after signature, freshness, schema, range, and state-hash admission
  4. Bounds before proportional allocation
  5. 32-peer default cap, four contexts per peer, 4096-byte message bound, 128 frames per one-second peer window
  6. Five-second snapshot age and advisory TTL, 500 ms future skew
  7. Whole-envelope residual rejection
  8. Payload-free saturating metrics
  9. Checked-in Cargo.lock and locked CI
  10. Default and no-default builds exclude LatentMesh

Verification

  1. cargo test --locked --workspace: 167 passed
  2. cargo test --locked --features latentmesh --all-targets: 191 passed
  3. cargo test --locked --no-default-features --all-targets: 136 passed
  4. Fresh-target cargo clippy --locked --features latentmesh --all-targets -- -D warnings: passed
  5. Loopback example: 292 logical bytes, 404 wire bytes, seven fragments at 64-byte MTU, ObserveOnly
  6. Criterion on Intel Xeon Platinum 8573C, Rust 1.98.0:
    1. State projection: 386.62 to 397.98 ns
    2. Sign and fragment: 38.677 to 39.616 microseconds
    3. Reassemble, verify, and admit: 47.952 to 51.988 microseconds
  7. RustSec: zero known vulnerabilities; one allowed pre-existing unmaintained transitive paste warning through nalgebra
  8. Ruflo deep security, STRIDE, and secrets scans: zero findings
  9. git diff --check and rustfmt checks: passed

Documentation

  1. docs/adr/ADR-173-latentmesh-comms-orchestration.md
  2. docs/security/latentmesh-threat-model.md
  3. examples/latentmesh_loopback.rs
  4. benches/latentmesh_bench.rs

Rollout and rollback

Roll out through disabled, loopback, shadow receive, canary, then advisory orchestration. Any LatentMesh command-interface call, unsigned admission, replay acceptance, unbounded memory, or hash mismatch admitted as success is an automatic rollback trigger.

The feature is off by default. Rollback is local: stop the adapter/session task or compile without latentmesh; existing flight and safety behavior remains intact.

Remaining release gate

Real RF and flight hardware are not claimed. Before operational flight, run two-node HIL on the target companion computer and transport hardware, calibrate link and energy thresholds, persist replay checkpoints in rollback-protected storage, use protected signing keys, verify clock health and key rotation, and record p50, p95, p99 plus allocation bounds.

@ruvnet
ruvnet merged commit f2d91fe into main Sep 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate LatentMesh as authenticated advisory communications and orchestration plane

1 participant